#include <func.h>

void loadingBar(off_t cur,off_t sum)
{
    double fcur = cur;
    double fsum = sum;
    double percentage = fcur / fsum;
    int mark = percentage*100/2;
    char buf[101] = {0};
    for(int i = 0;i<50;++i)
    {
        if(i<mark)
            buf[i] = '|';
        else if(mark<i)
            buf[i] = '.';
        else
            buf[i] = '>';
    }
    
    printf("%s :%.2lf \%\r",buf,percentage*100);
    fflush(stdout);
}

